package com.ds.common.route.config;

public enum Cluster {
    renkang("renkang"),
    corecustomers("corecustomers"),
    franchisees("franchisees"),
    gray("gray"),
    pre("pre"),
    dev("dev"),
    test1("test1"),
    test2("test1");
    String name;

    Cluster(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static boolean isValid(String name) {
        for (Cluster cluster : Cluster.values()) {
            if (cluster.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }

    /**
     * 判断是否是测试环境
     */
    public boolean isTestEnv() {
        return test1.getName().equals(name) || test2.getName().equals(name) || dev.getName().equals(name);
    }
}
